This RMarkdown plots the output of the model fits and simulations

##                mean      se_mean         sd      2.5%       25%       50%
## intercept 4.9670415 0.0022611320 0.06857007 4.8408813 4.9165926 4.9698577
## coef      0.6269134 0.0006529733 0.01880611 0.5902723 0.6128387 0.6267878
## sigma_vl  0.8785061 0.0009435690 0.02508941 0.8305398 0.8596759 0.8781823
## t_dof     8.6798023 0.0583875570 1.65201291 6.1009785 7.5227201 8.4578796
##                 75%      97.5%    n_eff      Rhat
## intercept 5.0121482  5.1008207 919.6390 0.9969748
## coef      0.6406164  0.6621930 829.4820 0.9993280
## sigma_vl  0.8959026  0.9276074 707.0231 1.0019773
## t_dof     9.6657497 12.3222168 800.5460 1.0012649
##                   mean     se_mean         sd      2.5%       25%       50%
## intercept[1] 1.4210639 0.107346893 0.51792685 0.4731717 1.0568497 1.4170214
## intercept[2] 5.5721391 0.005022655 0.09024346 5.3968523 5.5107993 5.5717195
## coef[1]      0.2050722 0.003779056 0.05182824 0.1085487 0.1670112 0.2029427
## coef[2]      1.0561185 0.015914938 0.09042128 0.9192284 0.9936826 1.0393825
## sigma_vl     0.7202433 0.001014772 0.02719554 0.6657211 0.7027074 0.7209976
## t_dof        5.5235087 0.027741947 0.82251154 4.2157087 4.9470522 5.3926004
##                   75%     97.5%     n_eff      Rhat
## intercept[1] 1.785558 2.3948606  23.27866 1.1024299
## intercept[2] 5.634702 5.7403255 322.82326 1.0113819
## coef[1]      0.238988 0.3099490 188.09023 1.0328515
## coef[2]      1.100133 1.2759119  32.27984 1.1339709
## sigma_vl     0.737933 0.7751848 718.22093 0.9957773
## t_dof        6.028853 7.3935975 879.04301 0.9972616
## There are a total of 280 infection episodes
## [1]  2 18
## [1] 8

Time to clearance

There are multiple ways to define time to clearance. We use time to first CT value equal to 40.

Model of viral clearance

Plot data - patients with known vaccination status

## [1] 0.289285

Spline fits

mgcv

Estimated parameters

Sensitivity analysis model 1

Sensitivity analysis model 2

Figure 1 - model fits

## Warning in predict.gam(mod_gam, data.frame(time = xs, ID = -1), re.effect = NA):
## factor levels -1 not in original fit

Individual fits data 1 - we pick the individuals with the most data

Compute area under the curve

## Doing D max = 5 ....
## Doing D max = 7 ....
## Doing D max = 14 ....

Reduction in AUCs

## Model 1: Wilcoxon test for AUC up to day 5: p= 0.0311334652416703
## Model 2: Wilcoxon test for AUC up to day 5: p= 0.186756104888986
## Model 1: Wilcoxon test for AUC up to day 7: p= 0.0311334652416703
## Model 2: Wilcoxon test for AUC up to day 7: p= 0.163340554379603
## Model 1: Wilcoxon test for AUC up to day 14: p= 0.0351837190994008
## Model 2: Wilcoxon test for AUC up to day 14: p= 0.231141448679665

## 
##  Welch Two Sample t-test
## 
## data:  colMeans(thetas_mod1$theta_rand[, not_vacc_ind, 2]) and colMeans(thetas_mod1$theta_rand[, vacc_ind, 2])
## t = -2.6264, df = 33.363, p-value = 0.01293
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.3577809 -0.0455068
## sample estimates:
##   mean of x   mean of y 
## -0.10579693  0.09584692

Variants and vaccines

effect of variant

## 
##             Alpha             Delta           Epsilon                NV 
##                14                50                12                27 
##           Omicron             Other       OtherVOIVOC Suspected Omicron 
##                40               107                 5                25

effect of vaccine

## 
##  0  1 
## 60 17

Sample size estimation

##   effect     power
## 1    1.0 0.0210000
## 2    1.3 0.4908750
## 3    1.5 0.7781875
##   t_design    power
## 1        1 0.676875
## 2        2 0.640750
## 3        3 0.633250
## 4        4 0.587250
## [1] 1000 1000
## 
## 5000 
##   33